/**
 * KafkaConsumerController.java
 *
 * @author: ZhuJiahui
 * @date: 2018/12/22 0:41
 */
package com.zhujiahui.sbkafka.first;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * @description:
 * @author: ZhuJiahui
 * @version: 1.0
 */
@Component
public class KafkaConsumerController {
    @KafkaListener(topics = "sbkafka")
    public void listen (ConsumerRecord<?, ?> record) throws Exception {
        System.out.printf("topic = %s, offset = %d, value = %s \n", record.topic(), record.offset(), record.value());
    }
}
